Confluence for Non-Full Functional Dependencies
نویسندگان
چکیده
Previous work on type inference for functional dependencies demands that the dependency must fully cover all parameters of a type class to guarantee that the constraint solver is confluent. However, several interesting programs rely on non-full functional dependencies. For these, the underlying constraint is nonconfluent, and hence type inference for these programs is possibly ill-behaved. We investigate two approaches to restore confluence for non-full FDs. In the first approach, we characterize a class of transformable non-full to full FD programs where the resulting full FD program is confluent. This approach has some inherent limitations due to the use of constraint simplification during type inference. In the second approach, we show how achieve confluence in general by applying a radically different type inference approach which favors constraint propagation over simplification. Our results provide new insights in type inference issues behind functional dependencies and help to clarify some of the on-going discussions about the possible adoption of functional dependencies in a future Haskell standard.
منابع مشابه
Restoring Confluence for Functional Dependencies
Haskell-style functional dependencies allow the programmer to influence the type inference process by automatically deriving type improvement rules from class and instance declarations. Previous work demands that the dependency must fully cover all type parameters of a type class to guarantee confluence. Confluence is an important property to ensure that type inference is well-behaved. We resto...
متن کاملObservable Confluence for Constraint Handling Rules
Constraint Handling Rules (CHRs) are a powerful rule based language for specifying constraint solvers. Critical for any rule based language is the notion of confluence, and for terminating CHRs there is a decidable test for confluence. But many CHR programs that in practice are confluent fail this confluence test. The problem is that the states that illustrate non-confluence are not reachable i...
متن کاملAccurate Functional Dependency Analysis for Constraint Handling Rules
Information about functional dependencies is used by modern CHR compilers for both optimisation and for further program analysis (e.g. confluence analysis). Before this work, CHR compilers relied on an ad hoc analysis for functional dependencies based on searching for rules of a particular form and the results from late storage analysis. We present a more formal functional dependency analysis o...
متن کاملFull Reduction in the Face of Absurdity
Core calculi that model the essence of computations use full reduction semantics to be built on solid grounds. Expressive type systems for these calculi may use propositions to refine the notion of types, which allows abstraction over possibly inconsistent hypotheses. To preserve type soundness, reduction must then be delayed until logical hypotheses on which the computation depends have been p...
متن کاملObservation of implicit complexity by non confluence
We propose to consider non confluence with respect to implicit complexity. We come back to some well known classes of first-order functional program, for which we have a characterization of their intentional properties, namely the class of cons-free programs, the class of programs with an interpretation, and the class of programs with a quasi-interpretation together with a termination proof by ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2008